package com.upb.webserver.common.pojo.rest.fabric.data;

import lombok.Data;

import java.util.List;
import java.util.Objects;

@Data
public class BaseOrgInfo {

    protected OrgTag orgTag;
    protected List<NodeInfo> nodes;

    @Data
    public static class OrgTag {
        private String mspId;
        private String domain; //eg. org1.example.com
    }

    @Data
    public static class NodeInfo {
        private String hostId;
        private String ip;
        private String hostName; //eg. peer0
        private String port;
        private String sshUser;
        private Integer sshPort;
        private Boolean isEnable;
        protected String type;

        public Boolean getIsEnable() {  //TODO 排查为啥返回空
            if (Objects.isNull(isEnable)) {
                return true;
            }
            return isEnable;
        }
    }
}
